Skip to content

Track if SelectEventPlugin is attached on a per document basis#8190

Merged
sebmarkbage merged 1 commit intofacebook:masterfrom
sebmarkbage:selecteventplugin
Nov 7, 2016
Merged

Track if SelectEventPlugin is attached on a per document basis#8190
sebmarkbage merged 1 commit intofacebook:masterfrom
sebmarkbage:selecteventplugin

Conversation

@sebmarkbage
Copy link
Copy Markdown
Contributor

This gets rid of the global flag on if something has listened to onSelect
and instead reads the isListening map if all the events are covered.
This is required if we want to attach events locally at roots.

Could be slower perf wise to handle events. An alternative solution would
be to attach a special flag on the listener map for the document so we
don't have to check the full dependency list.

However, my favorite solution would be to just eagerly attach all event
listeners (except maybe wheel). Then we don't have to do any of this stuff
on a per element basis.

@sebmarkbage
Copy link
Copy Markdown
Contributor Author

@vjeux This (or the alternative solutions) would be blocking attaching local listeners.

Copy link
Copy Markdown
Collaborator

@sophiebits sophiebits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little hard for me to convince myself that this is right for nested roots but I think it is.

This gets rid of the global flag on if something has listened to onSelect
and instead reads the isListening map if all the events are covered.
This is required if we want to attach events locally at roots.

Could be slower perf wise to handle events. An alternative solution would
be to attach a special flag on the listener map for the document so we
don't have to check the full dependency list.

However, my favorite solution would be to just eagerly attach all event
listeners (except maybe wheel). Then we don't have to do any of this stuff
on a per element basis.
@sebmarkbage sebmarkbage merged commit 95334fa into facebook:master Nov 7, 2016
acusti pushed a commit to brandcast/react that referenced this pull request Mar 15, 2017
…ook#8190)

This gets rid of the global flag on if something has listened to onSelect
and instead reads the isListening map if all the events are covered.
This is required if we want to attach events locally at roots.

Could be slower perf wise to handle events. An alternative solution would
be to attach a special flag on the listener map for the document so we
don't have to check the full dependency list.

However, my favorite solution would be to just eagerly attach all event
listeners (except maybe wheel). Then we don't have to do any of this stuff
on a per element basis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants